package com.wuzhiming.istudy.service.impl;

import com.wuzhiming.istudy.pojo.CourseStage;
import com.wuzhiming.istudy.service.BaseService;
import com.wuzhiming.istudy.service.CourseStageService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: CourseStageServiceImpl
 * @Description:
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/5 13:22
 */
@Service("courseStageService")
public class CourseStageServiceImpl extends BaseService implements CourseStageService {

    /**
    * @Description: 查询所有课程阶段按照课程类型分别
    * @Param: []
    * @return: java.util.List<com.wuzhiming.istudy.pojo.CourseStage>
    * @Author: zhimingw
    * @Date: 2022/3/5
    */
    @Override
    public List<CourseStage> queryAllById(Integer courseTypeId) {
        List<CourseStage> courseStages = courseStageMapper.queryAllById(courseTypeId);
        return courseStages;
    }

    @Override
    public Integer getCount(Integer status) {
        return courseStageMapper.getCount(status);
    }

    @Override
    public List<CourseStage> queryAll() {
        return courseStageMapper.queryAll();
    }

    @Override
    public boolean insert(CourseStage courseStage) {
        if(courseStageMapper.insert(courseStage)==1){
            return true;
        }
        return false;
    }

    @Override
    public CourseStage queryById(Integer id) {
        return courseStageMapper.queryById(id);
    }

    @Override
    public boolean update(CourseStage courseStage) {
        if(courseStageMapper.update(courseStage)==1){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteById(Integer id) {
        if(courseStageMapper.deleteById(id)==1){
            return true;
        }
        return false;
    }
}
